<?php

/**
 * 评论控制器
 */
class CommentController extends \Our\Controller_AbstractApi {

    /**
     * 增加评论
     */
    public function addAction() {
        $uid               = $this->_validLogin();
        $params            = $this->_getPost();
        $params['user_id'] = $uid;

        $caBN   = \Business\Comment\AddModel::getInstance();
        $result = $caBN->add($params);

        $this->_echoSuccessMessage("增加评论成功", $result);
    }

    /**
     * 评论接口
     */
    public function listAction() {
        $params = $this->_getQuery();

        $clBN   = \Business\Comment\ListModel::getInstance();
        $result = $clBN->commentList($params);

        $this->_echoSuccessMessage("评论列表", $result);
    }

}
